var regen = false;
$(function() {	
    reportSpace="reporter/daily/arm-daliy-product-reporter!";
    ns = reportSpace;
  	$(".datepicker" ).datepicker();
  	$("#compbtn").bind("click",function(){
  		var date = $( "#datepicker" ).val();  	
  		if(date==null || date==""){
  			var d = new Date();
  			var year   = d.getFullYear();
  		    var month  = d.getMonth()+1;
  		    var day    = d.getDate();
  		    date = year+"-"+month+"-"+day;
  		}
  		var url = reportSpace+"dailyCollation?usedate="+date;
  		window.open(url, '_collateWin');
  	});
  	
	$("div.pagination ul li a").bind("click",function(){
		var page = $(this).attr("page");
		var link = reportSpace+"query?page="+page+"&rows=10";
		doGet(link);	
		
	});
 
});

function checkregen(obj){
	regen = obj.checked;
}

function calcateStore(){
	var data  =$("#storeform").serialize();
    $.post(reportSpace+"updatestore",data,function(){
    	createNotify("结存重新计算完成");
    });
}